from rest_framework.serializers import ModelSerializer

from home.models import NavModel, BannerModel, cateModel


class NavSer(ModelSerializer):
    class Meta:
        model=NavModel
        fields='__all__'

class BannerSer(ModelSerializer):
    class Meta:
        model=BannerModel
        fields='__all__'


class Cate(ModelSerializer):
    class Meta:
        model=cateModel
        fields=["id","catename"]

class CateSer(ModelSerializer):
    children=Cate(many=True)
    class Meta:
        model=cateModel
        fields='__all__'